package com.gzhryc.net_marketing.cloud.account.dao.db;

import com.gzhryc.common.NumberTools;
import com.gzhryc.jdbc.annotaion.*;
import com.gzhryc.net_marketing.cloud.account.dao.enums.CloudPayAccountEnum;

import java.io.Serializable;
import java.util.Date;

/**
 * 云支付账号
 * @version 2022-07-04
 */
@Table(name="cloud_pay_account")
public class CloudPayAccount implements Serializable {

    private static final long serialVersionUID = 1L;

	@Id(auto = false)
    protected Long id;

    @Column(name="security_phone",notNull = true,note="安全手机")
    protected String securityPhone;
    
    @Column(notNull = true,note="类型")
    protected Integer type;

    @Column(name="visit_token",note="访问Token")
    protected String visitToken;

    @Column(name="pay_token",note="支付Token")
    protected String payToken;

    @Column(notNull = true,defVal = "0",note="余额")
    protected Integer money;

    @Column(name="freeze_money",notNull = true,defVal = "0",note="冻结金额")
    protected Integer freezeMoney;

    @Column(name="wxpay_app_id",note="微信支付AppId")
    protected String wxpayAppId;

    @Column(name="alipay_app_id",note="支付宝支付AppId")
    protected String alipayAppId;

    @Column(name="pay_notify_url",length = 255,note="支付通知路径")
    protected String payNotifyUrl;

    @Column(notNull = true,defVal = "1")
    protected Integer state;

    @Column(name = "update_money_date",note = "最后一次修改余额时间")
    protected Date updateMoneyDate;

    @Column(name = "update_freeze_money_date",note = "最后一次修改冻结金额时间")
    protected Date updateFreezeMoneyDate;

    @Column(name = "update_date", autoUpdateTime = true)
    protected Date updateDate;

    @Column(name = "create_date")
    protected Date createDate;
    
    @JoinField(name="name",fromField="id",toField="account_id",toTable="market_project_app",type="LEFT")
    protected String projectName;
    
    @JoinField(name="name",fromField="id",toField="account_id",toTable="market_supplier",type="LEFT")
    protected String supplierName;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getSecurityPhone() {
        return securityPhone;
    }

    public void setSecurityPhone(String securityPhone) {
        this.securityPhone = securityPhone;
    }
    
    public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public String getVisitToken() {
        return visitToken;
    }

    public void setVisitToken(String visitToken) {
        this.visitToken = visitToken;
    }

    public String getPayToken() {
        return payToken;
    }

    public void setPayToken(String payToken) {
        this.payToken = payToken;
    }

    public Integer getMoney() {
        return money;
    }

    public void setMoney(Integer money) {
        this.money = money;
    }

    public Integer getFreezeMoney() {
        return freezeMoney;
    }

    public void setFreezeMoney(Integer freezeMoney) {
        this.freezeMoney = freezeMoney;
    }

    public String getWxpayAppId() {
        return wxpayAppId;
    }

    public void setWxpayAppId(String wxpayAppId) {
        this.wxpayAppId = wxpayAppId;
    }

    public String getAlipayAppId() {
        return alipayAppId;
    }

    public void setAlipayAppId(String alipayAppId) {
        this.alipayAppId = alipayAppId;
    }

    public String getPayNotifyUrl() {
        return payNotifyUrl;
    }

    public void setPayNotifyUrl(String payNotifyUrl) {
        this.payNotifyUrl = payNotifyUrl;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public Date getUpdateMoneyDate() {
        return updateMoneyDate;
    }

    public void setUpdateMoneyDate(Date updateMoneyDate) {
        this.updateMoneyDate = updateMoneyDate;
    }

    public Date getUpdateFreezeMoneyDate() {
        return updateFreezeMoneyDate;
    }

    public void setUpdateFreezeMoneyDate(Date updateFreezeMoneyDate) {
        this.updateFreezeMoneyDate = updateFreezeMoneyDate;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public String getProjectName() {
		return projectName;
	}

	public void setProjectName(String projectName) {
		this.projectName = projectName;
	}

	public String getSupplierName() {
		return supplierName;
	}

	public void setSupplierName(String supplierName) {
		this.supplierName = supplierName;
	}

	public String getMoneyStr(){
        return NumberTools.getMoneyStr(this.money);
    }

    public String getFreezeMoneyStr(){
        return NumberTools.getMoneyStr(this.freezeMoney);
    }

    public String getStateName(){
        return CloudPayAccountEnum.State.note(this.state);
    }
    
    public String getTypeName() {
    	return CloudPayAccountEnum.Type.note(this.type);
    }
}
